package cn.swu.lzr.Safe;


import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import java.io.IOException;
import java.io.Writer;

public class Success extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException
    {
        //      boolean mark = false;
//        Cookie[]  cookies = request.getCookies();
        HttpSession session = request.getSession();
        String name = (String) session.getAttribute("username");
//        if (name != null)
//        {
//            mark = true;        }
        response.setContentType("text/html");
        response.setCharacterEncoding("UTF-8");
        Writer writer = response.getWriter();
        if(name!= null)
        {
           response.sendRedirect("/java-design/index.html");
        }


    }
}
